<% if (rf.canBeConditionallyDisplayed()) { %>
    <div class="fb-edit-section-conditional-wrapper">
        <div class='fb-edit-section-header'>Conditionally Display
            <span type="button" class="btn btn-link" data-toggle="tooltip" data-placement="bottom" title="Checkbox, Radio and Dropdown elements can be used to conditionally trigger the display of elements">
                <span class="glyphicon glyphicon-question-sign"></span>
            </span>
            <script>
              $('[data-toggle="tooltip"]').tooltip()
            </script>

        </div>
    <%
        var list = rf.collection.findConditionalTriggers(rf);
        if (list.length) { %>
            <select data-rv-value="model.<%= Formbuilder.options.mappings.CONDITIONAL_PARENT %>">
                <option></option>
                <% for (i in (list || [])) { %>
                    <option value="<%= list[i].get('uuid') %>">
                        <%- list[i].get('label') %>
                        <% if( rf.canShowReferenceID() &&  list[i].get('reference_id')) { %>
                        [<%= list[i].get('reference_id') %>]
                        <% } %>
                    </option>
                 <% } %>
            </select>
             <%
            var selectedList = rf.conditionalTriggerOptions();
            if (!Array.isArray(selectedList)) { %>
                <div>
                    <label class="checkbox">
                        <input type='checkbox' checked disabled />
                        <%= selectedList %>
                    </label>
                </div>
           <% } else {
                if (selectedList.length == 0)
                    rf.collection.clearConditionEle(rf);
                for (i in selectedList) { %>
                    <label class="checkbox">
                        <input type='checkbox' data-rv-append='model.<%= Formbuilder.options.mappings.CONDITIONAL_VALUES %>' value="<%= selectedList[i].uuid %>" />
                        <%= selectedList[i].label %>
                    </label>
                <% }
            }
        %>
    <% } else { %>
        No trigger elements
        <% } %>
    <% } %>
    <div id="warning-message" class="alert alert-danger" style="display:none">Please ensure that conditional values are selected</div>
    </div>
</div>
